package priv.stones.collections.map;

import sun.reflect.generics.tree.Tree;

import java.util.*;

/**
 * @Author: Stones
 * @Description:
 * @Date: 2017/11/5 17:32
 */
public class HashMap1 {

    public static void main(String[] args) {
        Map<Integer, String> data = new HashMap<Integer, String>();
        data.put(3, "胡锦阳111");
        data.put(50, "胡磊");
        data.put(20, "胡锦阳");
        System.out.println(data);

        Set<Map.Entry<Integer, String>> set = data.entrySet();
        Iterator<Map.Entry<Integer, String>> iterator = set.iterator();
        while (iterator.hasNext()) {
            Map.Entry<Integer, String> d = iterator.next();
            System.out.println(d.getKey()+"  =  "+d.getValue());
        }
    }

}
